<template>
	<view class="p-30 containerbox">
		<uv-navbar title="测试报告记录" auto-back placeholder />
		
		<z-paging class="containerbox" ref="paging" v-model="list" @query="querylist">
			<template #loading>
				<dw_loading :status="loading" />
			</template>
			
			<view 
				class="flex-between flex-center mb-30 pb-30 border-bottom" 
				v-for="({ wrongNumber, rightNumber, words, createdAt, id },index) in list" 
				:key="id"
				@tap="collectFn(id)"
			>
				<view class="flex-1">
					<view class="text-30 color-3a">词汇量：{{words}}   <text class="ml-20 mr-20">正确：{{rightNumber}}</text>    错误：{{wrongNumber}}</view>
					<view class="text-24 color6 mt-20">{{createdAt}}</view>
				</view>
				
				<view class="w-22 h-22">
					<fui-icon name="arrowright" size="35" color="#c2c5cc" />
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script setup>
	
	import { imgPath } from '@/common/config.js'
	import { ref } from 'vue'
	import { examlistPage } from '@/common/apis/study'
	
	let paging = ref(null)
	let list = ref([])
	let loading = ref(true)
	
	async function querylist(page, pageSize) {//获取列表
		let params = { page, pageSize, simplePage: 1 }
		let result = await examlistPage(params)
		paging.value.complete(result.list||[])
		uni.$fui.sleep(() => loading.value = false)
	}
	
	let collectFn = id => uni.$fui.href('/pages/other/report', { id })
	
</script>

<style>page{background-color: #fff}</style>
<style scoped lang="scss">
	.color-3a{color: #3A3F5E}
	.color6{color: #626780}
	.color9{color: #999999}
</style>